Feat/async job info query use informer#4484
Draft
fscnick wants to merge 6 commits intoray-project:masterfrom
Draft
Feat/async job info query use informer#4484fscnick wants to merge 6 commits intoray-project:masterfrom
fscnick wants to merge 6 commits intoray-project:masterfrom
Conversation
Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
…fo-query-use-informer
fscnick
commented
Feb 5, 2026
Comment on lines
+75
to
+83
| cacheStorage := otter.Must(&otter.Options[string, *JobInfoCache]{ | ||
| ExpiryCalculator: otter.ExpiryAccessing[string, *JobInfoCache](cacheExpiry), // Reset timer on reads/writes | ||
| OnDeletion: func(e otter.DeletionEvent[string, *JobInfoCache]) { | ||
| if !e.WasEvicted() { | ||
| return | ||
| } | ||
| logger.WithName("cacheStorage").Info("Evict cache for key.", "key", e.Key, "cause", e.Cause.String()) | ||
| }, | ||
| }) |
Collaborator
Author
There was a problem hiding this comment.
Use the cache without lru in case of there are too many RayJobs in cluster to compete the limit slots in lru cache.
Additionally, this cache provides auto expiry. The cleanup goroutine could be removed.
| continue | ||
| } | ||
|
|
||
| logger.Info("Listing RayJobs from cache", "total", len(rayJobs)) |
Collaborator
Author
There was a problem hiding this comment.
Should we keep this line of log? It might be a bit of noisy that it prints every queryInterval but without it the producer goroutine works almost silently.
Comment on lines
+61
to
+63
| if features.Enabled(features.AsyncJobInfoQuery) { | ||
| dashboardClientFunc = dashboardclient.GetCachedDashboardClientFunc() | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
By leveraging global variable, it could avoid modifying the existed function signature. Or, should we pass GetCachedDashboardClientFunc() as an argument or somewhat from the upper layer?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
According to #4160 (comment) ,this PR uses the informer cache to list RayJobs and query the
JobInfoin advance before calling getJobInfo. Additionally, it makes the query interval and etc configurable.How it works:
Related issue number
Closes #4069
Checks